function deepFreeze(obj) {
    if (!Object.isFrozen(obj)) {
        Object.freeze(obj);
    }

    for (const value of Object.values(obj)) {
        if (value instanceof Object) {
            deepFreeze(value);
        }
    }
}

